package 枚举;

import java.util.Arrays;
import java.util.List;

/**
 * @author DGW-PC
 * @data   2018年10月4日
 */
public class EnumValueOfTest {
	
	public enum database{c,d}
	
	// 枚举不能嵌套
	public enum dataTest{a,b,database}
	
	public static void main(String[] args) {
		
		List<Character> list = Arrays.asList('a','b','c','d');
		
		/*for (dataTest dTest : dataTest.values()) {
			System.out.println(dTest);
		}*/
		
		for (Character character : list) {
			try {
				dataTest.valueOf(character.toString());
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		
	}

	private static void m1() {
		Integer [] x =new Integer[] {1,2,3,4};
		Integer[] x2 = new Integer[x.length + 1];
		System.arraycopy(x, 0, x2, 0, x.length);
		x2[x.length] = 2;
		
		System.out.println(Arrays.toString(x2));
		
		Integer[] x3 = new Integer[x.length + x2.length];
		System.arraycopy(x, 0, x3, 0, x.length);
		System.arraycopy(x2, 0, x3, x.length, x2.length);
		
		System.out.println(Arrays.toString(x3));
	}

}
